#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main(int argc, char *argv[]) {

    char str[3][1024];
    for (size_t i = 0; i < 3; i++)
    {
        gets(str[i]);
    }
    
    int pha = 0, num = 0, blank = 0, others = 0;
    for (size_t i = 0; i < 3; i++)
    {
        for (size_t z = 0; z < strlen(str[i]); z++)
        {
            if(isalpha(str[i][z])!=0)
                pha++;
            else if(isdigit(str[i][z])!=0)
                num++;
            else if(isblank(str[i][z])!=0)
                blank++;
            else
                others++;
        }
        printf("%d %d %d %d\n", pha, num, blank, others);
        pha = 0, num = 0, blank = 0, others = 0;
    }
    

    return 0;
}